<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>

  <!-- 子模板 模板包含 -->
  {{ include './public/header.html' }}
  <% include('./public/header.html') %>

  <div>
    <!-- 绑定一个变量 -->
    <!-- 标准方案 -->
    <h3>{{title}}</h3>
    <h3>{{@ aTag }}</h3>
    {{if age<30}}
      <h3>少年</h3>
    {{else}}
      <h3>老年</h3>
    {{/if}}

    <!-- 循环  -->
    {{ each users }}
      <li>{{ $index }} -- {{ $value.name }}</li>
    {{ /each }}

    {{ each users val key }}
      <li>{{ key }} -- {{ val.name }}</li>
    {{ /each }}

    <hr>

    <!-- 原始方案  ejs -->
    <h3><%= title %></h3>
    <h3><%- aTag %></h3>
    <% if(age<30){ %>
      <h3>少年</h3>
    <% }else{ %>
      <h3>老年</h3>
    <% } %>

    <!-- 循环 -->
    <!-- <% users.forEach(item=>{ %>
      <li>{{ item.name }}</li>
    <% }) %> -->
    <% for(var i=0;i<users.length;i++) { %>
      <li>{{ users[i].name }}</li> 
    <% } %>
  </div>
</body>
</html>